package com.example.juc;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class FuturnTaskTest implements Callable<Boolean> {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        FuturnTaskTest futurnTaskTest = new FuturnTaskTest();
        FutureTask<Boolean> booleanFutureTask = new FutureTask<Boolean>(futurnTaskTest);
        new Thread(booleanFutureTask,"A").start();
        System.out.println(booleanFutureTask.get());

    }

    @Override
    public Boolean call() throws Exception {
        System.out.println(Thread.currentThread().getName());
        return true;
    }
}
